package xin.printk.android.utils;

import android.content.Context;

import java.util.ArrayList;
import java.util.List;

import xin.printk.android.R;
import xin.printk.android.data.entity.HomeItem;
import xin.printk.android.data.entity.NoteItem;

public class Mock {

    public static List<HomeItem> mockHomeItemData(Context context) {
        List<HomeItem> homeItems = new ArrayList<>();

        HomeItem android = new HomeItem();
        android.setImage(R.mipmap.cover_android);
        android.setTitle(context.getApplicationContext().getString(R.string.android));
        android.setDescription(context.getApplicationContext().getString(R.string.android_description));
        android.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(android);

        HomeItem java = new HomeItem();
        java.setImage(R.mipmap.cover_java);
        java.setTitle(context.getApplicationContext().getString(R.string.java));
        java.setDescription(context.getApplicationContext().getString(R.string.java_description));
        java.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(java);

        HomeItem kotlin = new HomeItem();
        kotlin.setImage(R.mipmap.cover_kotlin);
        kotlin.setTitle(context.getApplicationContext().getString(R.string.kotlin));
        kotlin.setDescription(context.getApplicationContext().getString(R.string.kotlin_description));
        kotlin.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(kotlin);

        HomeItem cplusplus = new HomeItem();
        cplusplus.setImage(R.mipmap.cover_cplusplus);
        cplusplus.setTitle(context.getApplicationContext().getString(R.string.cplusplus));
        cplusplus.setDescription(context.getApplicationContext().getString(R.string.cplusplus_description));
        cplusplus.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(cplusplus);

        HomeItem linux = new HomeItem();
        linux.setImage(R.mipmap.cover_linux);
        linux.setTitle(context.getApplicationContext().getString(R.string.linux));
        linux.setDescription(context.getApplicationContext().getString(R.string.linux_description));
        linux.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(linux);

        HomeItem ds = new HomeItem();
        ds.setImage(R.mipmap.cover_data_structure);
        ds.setTitle(context.getApplicationContext().getString(R.string.data_structure));
        ds.setDescription(context.getApplicationContext().getString(R.string.data_structure_description));
        ds.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(ds);

        HomeItem network = new HomeItem();
        network.setImage(R.mipmap.cover_network);
        network.setTitle(context.getApplicationContext().getString(R.string.computer_network));
        network.setDescription(context.getApplicationContext().getString(R.string.computer_network_description));
        network.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(network);

        HomeItem database = new HomeItem();
        database.setImage(R.mipmap.cover_database);
        database.setTitle(context.getApplicationContext().getString(R.string.database));
        database.setDescription(context.getApplicationContext().getString(R.string.database_description));
        database.setColor(context.getResources().getColor(R.color.colorPrimary));
        homeItems.add(database);

        return homeItems;
    }

    public static List<NoteItem> mockNoteItemData(Context context) {
        List<NoteItem> data = new ArrayList<>();

        NoteItem android = new NoteItem();
        android.setTitle(context.getApplicationContext().getString(R.string.android));
        android.setDescription(context.getApplicationContext().getString(R.string.description_0));
        android.setColor(context.getApplicationContext().getResources().getColor(R.color.green_light));
        data.add(android);

        NoteItem java = new NoteItem();
        java.setTitle(context.getApplicationContext().getString(R.string.java));
        java.setDescription(context.getApplicationContext().getString(R.string.description_1));
        java.setColor(context.getApplicationContext().getResources().getColor(R.color.orange_light));
        data.add(java);

        NoteItem kotlin = new NoteItem();
        kotlin.setTitle(context.getApplicationContext().getString(R.string.kotlin));
        kotlin.setDescription(context.getApplicationContext().getString(R.string.description_2));
        kotlin.setColor(context.getApplicationContext().getResources().getColor(R.color.yellow_light));
        data.add(kotlin);

        NoteItem cplusplus = new NoteItem();
        cplusplus.setTitle(context.getApplicationContext().getString(R.string.cplusplus));
        cplusplus.setDescription(context.getApplicationContext().getString(R.string.description_3));
        cplusplus.setColor(context.getApplicationContext().getResources().getColor(R.color.purple_light));
        data.add(cplusplus);

        NoteItem linux = new NoteItem();
        linux.setTitle(context.getApplicationContext().getString(R.string.linux));
        linux.setDescription(context.getApplicationContext().getString(R.string.description_4));
        linux.setColor(context.getApplicationContext().getResources().getColor(R.color.blue_light));
        data.add(linux);

        NoteItem ds = new NoteItem();
        ds.setTitle(context.getApplicationContext().getString(R.string.data_structure));
        ds.setDescription(context.getApplicationContext().getString(R.string.description_5));
        ds.setColor(context.getApplicationContext().getResources().getColor(R.color.black_light));
        data.add(ds);

        NoteItem network = new NoteItem();
        network.setTitle(context.getApplicationContext().getString(R.string.computer_network));
        network.setDescription(context.getApplicationContext().getString(R.string.description_6));
        network.setColor(context.getApplicationContext().getResources().getColor(R.color.cyan_light));
        data.add(network);

        NoteItem database = new NoteItem();
        database.setTitle(context.getApplicationContext().getString(R.string.database));
        database.setDescription(context.getApplicationContext().getString(R.string.description_7));
        database.setColor(context.getApplicationContext().getResources().getColor(R.color.gray_light));
        data.add(database);

        return data;
    }

    public static List<NoteItem> mockMoreNoteItemData(Context context) {
        List<NoteItem> data = new ArrayList<>();

        NoteItem network = new NoteItem();
        network.setTitle(context.getApplicationContext().getString(R.string.computer_network));
        network.setDescription(context.getApplicationContext().getString(R.string.description_6));
        network.setColor(context.getApplicationContext().getResources().getColor(R.color.cyan_light));
        data.add(network);

        NoteItem database = new NoteItem();
        database.setTitle(context.getApplicationContext().getString(R.string.database));
        database.setDescription(context.getApplicationContext().getString(R.string.description_7));
        database.setColor(context.getApplicationContext().getResources().getColor(R.color.gray_light));
        data.add(database);

        data.addAll(mockNoteItemData(context));

        NoteItem android = new NoteItem();
        android.setTitle(context.getApplicationContext().getString(R.string.android));
        android.setDescription(context.getApplicationContext().getString(R.string.description_0));
        android.setColor(context.getApplicationContext().getResources().getColor(R.color.green_light));
        data.add(android);

        NoteItem java = new NoteItem();
        java.setTitle(context.getApplicationContext().getString(R.string.java));
        java.setDescription(context.getApplicationContext().getString(R.string.description_1));
        java.setColor(context.getApplicationContext().getResources().getColor(R.color.orange_light));
        data.add(java);

        return data;
    }
}
